package com.test.designPattern.ch19;

/**
 * @ClassName Originator
 * @Description TODO
 * @Author 维康
 * @Date 2018/6/13 10:33
 * @Version 1.0
 **/
public class Originator {
    private String state;

    public void setState(String state){
        this.state = state;
    }

    public String getState(){
        return state;
    }

    public Memento saveStateToMemento(){
        return new Memento(state);
    }

    public void getStateFromMemento(Memento memento){
        state = memento.getState();
    }
}
